<?php
namespace app\exception;

use support\exception\BusinessException;
use Webman\Http\Request;
use Webman\Http\Response;


class Myexc extends BusinessException
{
	protected  $data;
	protected  $msg;
	protected  $code;
	public function __construct($msg, $code,$data){
		$this->data=$data;
		$this->msg=$msg;
		$this->code=$code;
	}
    public function render(Request $request): ?Response
    {
        return json(['code' => $this->code ?: 500, 'message' => $this->msg,'data'=>$this->data]);
        
    }
}